using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace Slqj.Data
{
	public static class TableTicketPackage
	{
		public const string Table = "TicketPackage";
		public const string TicketPackageID = "TicketPackageID";
		public const string TicketPackageName = "TicketPackageName";
		public const string TicketsID = "TicketsID";
		public const string GuestRoomID = "GuestRoomID";
		public const string TicketQty = "TicketQty";
		public const string GuestRoomQty = "GuestRoomQty";
		public const string TotalAmount = "TotalAmount";
		public const string Sort = "Sort";
		public const string Creater = "Creater";
		public const string CreatedBy = "CreatedBy";
		public const string Created = "Created";
		public const string Modified = "Modified";
		public const string ModifiedBy = "ModifiedBy";
		public const string ModifiedByID = "ModifiedByID";
	}
	
	[Serializable]
	public class BaseTicketPackage
		: IDbSessionEntity, IJsonClass
	{
		int m_TicketPackageID;
		/// <summary>
        /// 
        /// </summary>
        public int TicketPackageID
        {
            get { return m_TicketPackageID; }
            set { m_TicketPackageID = value; }
        }
		
		string m_TicketPackageName;
		/// <summary>
        /// 
        /// </summary>
        public string TicketPackageName
        {
            get { return m_TicketPackageName; }
            set { m_TicketPackageName = value; }
        }
		
		int? m_TicketsID;
		/// <summary>
        /// 
        /// </summary>
        public int? TicketsID
        {
            get { return m_TicketsID; }
            set { m_TicketsID = value; }
        }
		
		int? m_GuestRoomID;
		/// <summary>
        /// 
        /// </summary>
        public int? GuestRoomID
        {
            get { return m_GuestRoomID; }
            set { m_GuestRoomID = value; }
        }
		
		int m_TicketQty;
		/// <summary>
        /// 
        /// </summary>
        public int TicketQty
        {
            get { return m_TicketQty; }
            set { m_TicketQty = value; }
        }
		
		int m_GuestRoomQty;
		/// <summary>
        /// 
        /// </summary>
        public int GuestRoomQty
        {
            get { return m_GuestRoomQty; }
            set { m_GuestRoomQty = value; }
        }
		
		double m_TotalAmount;
		/// <summary>
        /// 
        /// </summary>
        public double TotalAmount
        {
            get { return m_TotalAmount; }
            set { m_TotalAmount = value; }
        }
		
		int m_Sort;
		/// <summary>
        /// 
        /// </summary>
        public int Sort
        {
            get { return m_Sort; }
            set { m_Sort = value; }
        }
		
		int m_Creater;
		/// <summary>
        /// 
        /// </summary>
        public int Creater
        {
            get { return m_Creater; }
            set { m_Creater = value; }
        }
		
		string m_CreatedBy;
		/// <summary>
        /// 
        /// </summary>
        public string CreatedBy
        {
            get { return m_CreatedBy; }
            set { m_CreatedBy = value; }
        }
		
		DateTime m_Created;
		/// <summary>
        /// 
        /// </summary>
        public DateTime Created
        {
            get { return m_Created; }
            set { m_Created = value; }
        }
		
		DateTime m_Modified;
		/// <summary>
        /// 
        /// </summary>
        public DateTime Modified
        {
            get { return m_Modified; }
            set { m_Modified = value; }
        }
		
		string m_ModifiedBy;
		/// <summary>
        /// 
        /// </summary>
        public string ModifiedBy
        {
            get { return m_ModifiedBy; }
            set { m_ModifiedBy = value; }
        }
		
		int? m_ModifiedByID;
		/// <summary>
        /// 
        /// </summary>
        public int? ModifiedByID
        {
            get { return m_ModifiedByID; }
            set { m_ModifiedByID = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_TicketPackageID = reader[TableTicketPackage.TicketPackageID];
            m_TicketPackageName = reader[TableTicketPackage.TicketPackageName];
            m_TicketsID = reader[TableTicketPackage.TicketsID];
            m_GuestRoomID = reader[TableTicketPackage.GuestRoomID];
            m_TicketQty = reader[TableTicketPackage.TicketQty];
            m_GuestRoomQty = reader[TableTicketPackage.GuestRoomQty];
            m_TotalAmount = reader[TableTicketPackage.TotalAmount];
            m_Sort = reader[TableTicketPackage.Sort];
            m_Creater = reader[TableTicketPackage.Creater];
            m_CreatedBy = reader[TableTicketPackage.CreatedBy];
            m_Created = reader[TableTicketPackage.Created];
            m_Modified = reader[TableTicketPackage.Modified];
            m_ModifiedBy = reader[TableTicketPackage.ModifiedBy];
            m_ModifiedByID = reader[TableTicketPackage.ModifiedByID];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableTicketPackage.TicketPackageID, PrimaryKeyType.Identity, TicketPackageID);
			writer[TableTicketPackage.TicketPackageName] = TicketPackageName;
			writer[TableTicketPackage.TicketsID] = TicketsID;
			writer[TableTicketPackage.GuestRoomID] = GuestRoomID;
			writer[TableTicketPackage.TicketQty] = TicketQty;
			writer[TableTicketPackage.GuestRoomQty] = GuestRoomQty;
			writer[TableTicketPackage.TotalAmount] = TotalAmount;
			writer[TableTicketPackage.Sort] = Sort;
			writer[TableTicketPackage.Creater] = Creater;
			writer[TableTicketPackage.CreatedBy] = CreatedBy;
			writer[TableTicketPackage.Created] = Created;
			writer[TableTicketPackage.Modified] = Modified;
			writer[TableTicketPackage.ModifiedBy] = ModifiedBy;
			writer[TableTicketPackage.ModifiedByID] = ModifiedByID;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_TicketPackageID = idd;
        }
		
		public string TableName
        {
            get { return TableTicketPackage.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_TicketPackageID = hashToRead["TicketPackageID"];
			 
             m_TicketPackageName = hashToRead["TicketPackageName"];
			 
             m_TicketsID = hashToRead["TicketsID"];
			 
             m_GuestRoomID = hashToRead["GuestRoomID"];
			 
             m_TicketQty = hashToRead["TicketQty"];
			 
             m_GuestRoomQty = hashToRead["GuestRoomQty"];
			 
             m_TotalAmount = hashToRead["TotalAmount"];
			 
             m_Sort = hashToRead["Sort"];
			 
             m_Creater = hashToRead["Creater"];
			 
             m_CreatedBy = hashToRead["CreatedBy"];
			 
             m_Created = hashToRead["Created"];
			 
             m_Modified = hashToRead["Modified"];
			 
             m_ModifiedBy = hashToRead["ModifiedBy"];
			 
             m_ModifiedByID = hashToRead["ModifiedByID"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["TicketPackageID"] = TicketPackageID;
			 
            hashToFill["TicketPackageName"] = TicketPackageName;
			 
            hashToFill["TicketsID"] = TicketsID;
			 
            hashToFill["GuestRoomID"] = GuestRoomID;
			 
            hashToFill["TicketQty"] = TicketQty;
			 
            hashToFill["GuestRoomQty"] = GuestRoomQty;
			 
            hashToFill["TotalAmount"] = TotalAmount;
			 
            hashToFill["Sort"] = Sort;
			 
            hashToFill["Creater"] = Creater;
			 
            hashToFill["CreatedBy"] = CreatedBy;
			 
            hashToFill["Created"] = Created;
			 
            hashToFill["Modified"] = Modified;
			 
            hashToFill["ModifiedBy"] = ModifiedBy;
			 
            hashToFill["ModifiedByID"] = ModifiedByID;
			 
        }

        #endregion
		
	}
}
